package study.sort;

public class BubbleSortTest {

	public static void main(String args[]) {
		int[] arrays = new int[] { 10, 7, 3, 40, 5, 1, 8 };

		for (int i = 0; i < arrays.length; i++) {
			for (int j = 0; j < arrays.length; j++) {
				if(arrays[i] > arrays[j]){
					int t = arrays[i];
					arrays[i] = arrays[j]; 
					arrays[j] = t;
				}
			}
			
			for (int j = 0; j < arrays.length; j++) {
				System.out.print(arrays[j]+" ");
				if(arrays.length -1 == j)
					System.out.println();
			}
		}

	}
}
